<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
				xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
				xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<title>故障档案</title>
		<!-- <link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" /> -->
		<style type="text/css">
.ui-datatable-scrollable-header-box {
	margin-left: 0px;
	margin-right: 15px !important;
}

.ui-datalist-empty-message {
	min-height: 100px;
}

.ui-datalist-content {
	min-height: 100px;
}

.faultForm:faultTime_input {
	width: 100px;
	!
	important;
}

#addFaultReportForm .ui-calendar>.ui-state-default {
	border: 0px;
}

.ui-button-icon-only .ui-button-text {
	padding: .3em;
	text-indent: -9999999px;
	height: 27px;
}

/**如果datable使用了：resizableColumns ="true"，需要增加以下样式**/
.ui-datatable-resizable {
	overflow: visible !important;
}
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div id="headDiv" class="box box-solid with-border">
			<h:form id="headForm">
				<div class="box-header" id="queryDiv">
					<p:commandButton value="选择设备" id="chooseBtn" style="margin-right:5px;display:none"
									 actionListener="#{faultReportController.getEquipmentByStation()}">
						<p:ajax event="dialogReturn" listener="#{faultReportController.onFaultDeviceChosen}"
								update="faultDevice" />
					</p:commandButton>
					<div style="float: left; width: 150px">
						<div class="ui-inputgroup">
							<p:inputText placeholder="故障设备" id="faultDevice" value="#{faultReportController.faultDevice}"
										 style="width:110px;" />
							<p:commandButton icon="fa fa-search"
											 onclick="document.getElementById('headForm:chooseBtn').click()" styleClass="white-button"
											 style="height:28px" />
						</div>
					</div>
					<p:outputLabel value="电压等级：" style="margin-left:10px;" />
					<h:selectOneMenu id="voltageLevel" value="#{faultReportController.selectedVoltage}"
									 style="width:120px;height:30px;margin-right:10px;">
						<f:selectItem itemLabel="全部" itemValue="" />
						<f:selectItem itemLabel="500kV及以上" itemValue="499" />
						<f:selectItem itemLabel="220kV" itemValue="220" />
					</h:selectOneMenu>
					<p:outputLabel value="是否故障：" />
					<h:selectOneMenu id="isFault" value="#{faultReportController.isFault}"
									 style="width:80px;margin-right:10px;height:30px">
						<f:selectItem itemLabel="全部" itemValue="null" />
						<f:selectItem itemLabel="故障" itemValue="0" />
						<f:selectItem itemLabel="非故障" itemValue="1" />
					</h:selectOneMenu>
					<p:outputLabel for="popup7" value="故障时间：" />
					<p:calendar id="popup7" navigator="true" value="#{faultReportController.queryDate1}"
								pattern="yyyy-MM-dd" maxdate="Date()" size="12">
						<p:ajax event="dateSelect" listener="#{faultReportController.onDateSelectStart}" />
					</p:calendar>
					<p:outputLabel for="popup8" value="至 " style="margin-right:5px;margin-left:5px;" />
					<p:calendar id="popup8" navigator="true" value="#{faultReportController.queryDate2}"
								pattern="yyyy-MM-dd" maxdate="Date()" size="12">
						<p:ajax event="dateSelect" listener="#{faultReportController.onDateSelectEnd}" />
					</p:calendar>
					<p:commandButton value="查询" id="query2" oncomplete="getTableScrollHeight()"
									 update="form:dataTb headForm:toolbar" icon="ui-icon-search"
									 actionListener="#{faultReportController.queryByTime}" style="margin-left:10px;">
					</p:commandButton>
					<p:commandButton icon="ui-icon-refresh" value="重置"
									 actionListener="#{faultReportController.resetQuery}" style="margin-left:5px;"
									 oncomplete="getTableScrollHeight()"
									 update="chooseBtn faultDevice isFault voltageLevel popup7 popup8 headForm:toolbar form:dataTb  faultType faultReason" />
					<div class="box-tools pull-right">
						<button type="button" id="selectButton" title="高级查询" class="btn btn-default"
								onclick="onSelectDivClick();" style="margin-right: 50px;">
							<span id="selectButtonIcon" class="fa fa-caret-down">高级查询</span>
						</button>
					</div>
				</div>
				<div class="panel-collapse collapse" id="selectDiv">
					<p:outputLabel value="故障类型：" style="margin-left:10px;" />
					<p:inputText id="faultType" value="#{faultReportController.queryFault.faultType}"></p:inputText>
					<p:outputLabel value="故障原因分类：" style="margin-left:10px;" />
					<p:inputText id="faultReason" value="#{faultReportController.queryFault.faultReson}"></p:inputText>
				</div>
				<div id="toolbarDiv">
					<p:toolbar id="toolbar">
						<f:facet name="left">
							<p:commandButton value="新建" icon="ui-icon-document"
											 actionListener="#{faultReportController.preCreateFault}"
											 rendered="#{s:hasPermission(session,'bhyx_gzfx_xj')}" update=":faultForm:createFaultDialog"
											 oncomplete="PF('createFaultDialog').show()" />
							<p:commandButton value="编辑" icon="ui-icon-pencil"
											 disabled="#{faultReportController.selectFaults == null or faultReportController.selectFaults.size()!=1}"
											 actionListener="#{faultReportController.preEditFault}" update=":faultForm:createFaultDialog"
											 rendered="#{s:hasPermission(session,'bhyx_gzfx_bj')}" />
							<p:commandButton value="删除" icon="ui-icon-trash"
											 rendered="#{s:hasPermission(session,'bhyx_gzfx_sc')}"
											 actionListener="#{faultReportController.deleteFault}"
											 disabled="#{faultReportController.selectFaults == null or faultReportController.selectFaults.size()==0}"
											 update="form:dataTb form:msgs headForm:toolbar" oncomplete="getTableScrollHeight()">
								<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
							</p:commandButton>
							<p:commandButton id="uploadUnit" style="margin-left:10px;" icon="ui-icon-arrowthick-1-n"
											 value="上传" actionListener="#{faultReportController.chooseEquipment}">
								<p:ajax event="dialogReturn" listener="#{faultReportController.onSelectorChosen}"
										oncomplete="getTableScrollHeight();" update="form:dataTb form:msgs" />
							</p:commandButton>
							<p:commandButton value="导出故障详情" icon="ui-icon-arrowthick-1-s"
											 rendered="#{s:hasPermission(session,'bhyx_gzda_dcgzxq')}"
											 actionListener="#{faultReportController.exportFaultDetail()}" ajax="false">
								<p:fileDownload value="#{faultReportController.file}" />
							</p:commandButton>
							<p:commandButton value="故障锁定情况" icon="ui-icon-alert"
											 oncomplete="PF('faultEditLockedInfo').show()" update="lockedForm:faultEditLockedInfo"
											 rendered="#{s:hasPermission(session,'bhyx_gzda_gzsdqk')}"
											 actionListener="#{faultEditLockedInfoController.init()}">
							</p:commandButton>
							<p:commandButton value="置为非故障" icon="ui-icon-alert" update="form:dataTb form:msgs"
											 oncomplete="PF('confirmDialog1').show();getTableScrollHeight();">
							</p:commandButton>
							<p:commandButton value="置为故障" icon="ui-icon-alert" update="form:dataTb form:msgs"
											 oncomplete="PF('confirmDialog2').show();getTableScrollHeight();">
							</p:commandButton>
							<p:commandButton id="mergeFaultButton" value="合并故障" icon="ui-icon-document"
											 disabled="#{faultReportController.selectFaults == null or faultReportController.selectFaults.size() &lt; 2}"
											 actionListener="#{faultReportController.loadAttachmentAndWaveFiles}"
											 update="mergePickForm:mergeFaultDialog  mergePickForm:mergeFaultDialog1 form:msgs">
							</p:commandButton>
							<p:commandButton value="OMS数据导入" onclick="PF('fileUploadDialog').show()" />
						</f:facet>
					</p:toolbar>
				</div>
			</h:form>
		</div>
		<div id="infoDiv" class="box box-solid with-border">
			<h:form id="form">
				<p:growl id="msgs" showDetail="true" />
				<p:dataTable id="dataTb" var="item" value="#{faultReportController.lineFaultsModel}"
							 rowKey="#{item.id}" emptyMessage="无记录" rows="20" paginator="true"
							 paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
								{LastPageLink} {RowsPerPageDropdown}"
							 lazy="true" editable="true" editMode="cell" rowIndexVar="ite"
							 selection="#{faultReportController.selectFaults}" resizableColumns="true"
							 rowsPerPageTemplate="20,30,50" paginatorPosition="bottom" liveResize="true"
							 rowSelectMode="checkbox" disabledTextSelection="false" scrollable="true">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{faultReportController.count} 条记录" style="margin-right:20px;"></p:outputLabel>
					</f:facet>
					<p:ajax event="toggleSelect" update="headForm:toolbar"/>
					<p:ajax event="rowSelectCheckbox" update="headForm:toolbar" />
					<p:ajax event="rowUnselectCheckbox" update="headForm:toolbar" />
					<p:ajax event="rowSelect" update="headForm:toolbar" />
					<p:ajax event="rowUnselect" update="headForm:toolbar" />
					<p:column selectionMode="multiple" style="width:8px;text-align:center" />
					<p:column width="10" headerText="序号 ">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column selectRow="false" width="40" headerText="故障时间 " style="text-align:center;">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="30" headerText="故障设备" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.equipment}" />
					</p:column>
					<p:column width="25" headerText="故障类型" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultType}" />
					</p:column>
					<p:column width="35" headerText="故障原因分类">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultReson}" />
					</p:column>
					<p:column width="15" headerText="相别" style="text-align:center">
						<h:outputText value="#{item.faultPhase}" />
					</p:column>
					<p:column width="60" headerText="行波测距">
						<h:outputText style="white-space:pre-wrap;" value="#{item.ranging}" escape="false" />
					</p:column>
					<p:column width="60" headerText="故障原因">
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.remark}"
									  escape="false" rendered="#{item.remark.length()&lt;=60}"/>
						<p:outputPanel rendered="#{item.remark.length()&gt;60}">
							<p:commandLink style="white-space:pre-wrap;"  value="#{item.remark.substring(0,60)}..." update=":form:textDetail" oncomplete="PF('carOP').show('#{component.clientId}')">
				                <f:setPropertyActionListener value="#{item.remark}" target="#{faultReportController.selectedText}" />
				            </p:commandLink>
						</p:outputPanel>			  
					    
					</p:column>
					<p:column width="60" headerText="智能分析">
						<!-- <h:outputText style="white-space:pre-wrap;display:block;" value="#{item.thunderInfo}"
									  escape="false" />
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.iceInfo}"
									  escape="false" /> -->
									  
					     <h:outputText style="white-space:pre-wrap;display:block;" value="#{item.thunderInfo}#{item.iceInfo}"
									  escape="false" rendered="#{(item.thunderInfo.length()+item.iceInfo.length())&lt;=60}"/>
						<p:outputPanel rendered="#{(item.thunderInfo.length()+item.iceInfo.length())&gt;60}">
							<p:commandLink style="white-space:pre-wrap;"  value="#{item.thunderInfo.substring(0,60)}..." update=":form:textDetail" oncomplete="PF('carOP').show('#{component.clientId}')">
				                <f:setPropertyActionListener value="#{item.thunderInfo}#{item.iceInfo}" target="#{faultReportController.selectedText}" />
				            </p:commandLink>
						</p:outputPanel>	
					</p:column>
					<p:column width="105" headerText="故障过程">
						<!-- <h:outputText style="white-space:pre-wrap;" value="#{item.description}" escape="false" /> -->
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.description}"
									  escape="false" rendered="#{item.description.length()&lt;=60}"/>
						<p:outputPanel rendered="#{item.description.length()&gt;60}">
							<p:commandLink style="white-space:pre-wrap;"  value="#{item.description.substring(0,60)}..." update=":form:textDetail" oncomplete="PF('carOP').show('#{component.clientId}')">
				                <f:setPropertyActionListener value="#{item.description}" target="#{faultReportController.selectedText}" />
				            </p:commandLink>
						</p:outputPanel>	
					</p:column>
					<p:column width="35" headerText="故障来源" style="text-align:center">
						<h:outputText rendered="#{null==item.source}" value="" />
						<h:outputText rendered="#{0==item.source}" value="人工创建" />
						<h:outputText rendered="#{1==item.source}" value="集中录波" />
						<h:outputText rendered="#{2==item.source}" value="保护录波" />
						<h:outputText rendered="#{3==item.source}" value="跳闸记录" />
						<h:outputText rendered="#{4==item.source}" value="调度日志" />
					</p:column>
					<p:column width="35" headerText="是否故障" style="text-align:center;">
						<p:cellEditor>
							<f:facet name="output">
								<h:outputText value="#{faultReportController.getStatusText(item.status)}" />
							</f:facet>
							<f:facet name="input">
								<h:selectOneMenu value="#{item.status}"
												 style="margin-left:8px;width:80px;height:27px;color:black;background-color:white;">
									<f:selectItem itemLabel="故障" itemValue="0" />
									<f:selectItem itemLabel="非故障" itemValue="1" />
									<p:ajax event="change" listener="#{faultReportController.setSelectEdit(item)}"
											oncomplete="PF('confirmDialog').show()"></p:ajax>
								</h:selectOneMenu>
							</f:facet>
						</p:cellEditor>
					</p:column>
					<p:column width="35" headerText="是否推送" style="text-align:center;">
						<p:cellEditor>
							<f:facet name="output">
								<h:outputText rendered="#{item.push==1}" style="color:blue"
											  value="#{faultReportController.getPushText(item.push)}" />
								<h:outputText rendered="#{item.push!=1}"
											  value="#{faultReportController.getPushText(item.push)}" />
							</f:facet>
							<f:facet name="input">
								<h:selectOneMenu value="#{item.push}"
												 style="margin-left:8px;width:80px;height:27px;color:black;background-color:white;">
									<f:selectItem itemLabel="推送" itemValue="0" />
									<f:selectItem itemLabel="不推送" itemValue="1" />
									<p:ajax event="change" listener="#{faultReportController.setSelectEdit(item)}"
											oncomplete="PF('confirmDialog5').show()"></p:ajax>
								</h:selectOneMenu>
							</f:facet>
						</p:cellEditor>
					</p:column>
					<p:column headerText="报告" width="10" style="text-align: center" exportable="false">
						<p:commandLink style="color: red" styleClass="ui-commandlink ui-widget fa fa-map-o"
									   disabled="#{item.equipment_id == null || (item.etype != '线路' &amp;&amp; item.etype != '母线' &amp;&amp; item.etype != '变压器')}"
									   actionListener="#{faultReportController.openFaultDialog(item)}" update="form:msgs" title="故障报告" />
					</p:column>
					<p:column headerText="日志" width="10" style="text-align: center" exportable="false">
						<p:commandLink style="color: blue" styleClass="ui-commandlink ui-widget fa fa-map-o"
									   disabled="#{item.equipment_id == null || (item.etype != '线路' &amp;&amp; item.etype != '母线' &amp;&amp; item.etype != '变压器')}"
									   actionListener="#{faultReportController.openFaultLogDialog(item)}" update="form:msgs" title="故障分析日志" />
						<p:commandLink style="color: red;margin-left:20px; "
									   styleClass="ui-commandlink ui-widget fa fa-stack-overflow"
									   actionListener="#{faultReportController.openFaultProcess(item)}"
									   oncomplete="PF('faultProcessDialog').show()"
									   update="faultProcessDialogForm:faultProcessPanel" />
					</p:column>
					<p:column headerText="录波文件" width="25" style="text-align: center" exportable="false">
						<p:commandLink styleClass="fa fa-upload" update="form:msgs form:uploadWaveFileDialog"
									   actionListener="#{waveFileController.initByFault(item)}"
									   rendered="#{s:hasPermission(session,'bhyx_gzfx_scwj')}"
									   oncomplete="PF('uploadWaveFileDialog').show()" title="上传" />
						<p:commandLink styleClass="fa fa-download"
									   update="form:msgs downloadForm:downloadWaveFileDialog" style="margin-left:20px;"
									   id="downloadBtn" rendered="#{s:hasPermission(session,'bhyx_gzfx_xz')}"
									   oncomplete="PF('downloadWaveFileDialog').show()"
									   actionListener="#{waveFileController.initByFault(item)}" title="下载">
						</p:commandLink>
					</p:column>
				</p:dataTable>
				<p:overlayPanel style="width:200px" widgetVar="carOP" showEffect="fade" hideEffect="fade" dismissable="true">
			        <p:outputPanel id="textDetail" style="text-align:center;">
			             <h:outputText value="#{faultReportController.selectedText}" />
			        </p:outputPanel>
                </p:overlayPanel>
				<p:dialog id="confirmDialog" widgetVar="confirmDialog" modal="true" header="提示" width="220"
						  height="120" closable="false">
					确定要修改故障状态吗？<br />
					<br />
					<br />
					<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
									 icon="ui-icon-check" oncomplete="PF('confirmDialog').hide();getTableScrollHeight();"
									 actionListener="#{faultReportController.editFaultStatus(faultReportController.selectEdit)}"
									 update="form:dataTb form:msgs" />
					<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
									 oncomplete="PF('confirmDialog').hide();getTableScrollHeight();" update="form:dataTb"
									 actionListener="#{faultReportController.queryByTime}" />
				</p:dialog>
				<p:remoteCommand name="refreshTable" update="form:dataTb" oncomplete="getTableScrollHeight();" />
				<h:inputHidden value="#{fileUploadManagerController.oid}" />
				<!-- 上传录波文件 -->
				<p:dialog widgetVar="uploadWaveFileDialog" id="uploadWaveFileDialog" header="录波文件上传"
						  modal="true" width="900" height="620" onHide="refreshTable();">
					<p:outputPanel id="waveFilePanel">
						<table style="width: 100%">
							<tr>
								<td><small><span class="fa fa-warning" style="color: #f39c12" />
									上传录波文件时，应选择与之对应的录波设备，并<b>同时上传.cfg和.dat文件</b>。右侧可选择全部录波设备。 <br /> <span
											class="fa fa-warning" style="color: #f39c12" /> 如果不是本次故障的录波文件，系统将会系统生成错误的故障数据。 </small></td>
								<td><p:selectBooleanButton style="float:right"
														   value="#{waveFileController.showRelatedEquipment}" onLabel="全部录波设备" offLabel="相关录波设备">
									<p:ajax update="waveFilePanel" listener="#{waveFileController.changeWaveEquipmentList}" />
								</p:selectBooleanButton></td>
							</tr>
						</table>
						<p:dataTable id="waveEquipmentTable" var="we"
									 value="#{waveFileController.getCurrentWaveEquipmentList('')}"
									 selection="#{waveFileController.selectedWaveEquipment}" selectionMode="single"
									 rowKey="#{we.id}" emptyMessage="无记录" sortBy="#{we.subName}">
							<p:ajax event="rowSelect" update="form:uploadCom form:uploadMsg form:waveFilePanel"
									listener="#{waveFileController.onWaveEquipmentRowSelect}" />
							<p:ajax event="rowUnselect" update="form:uploadCom form:uploadMsg form:waveFilePanel"
									listener="#{waveFileController.onWaveEquipmentRowUnSelect}" />
							<p:column groupRow="true" headerText="变电站">
								<h:outputText value="#{we.subName}" />
							</p:column>
							<p:column headerText="类型">
								<h:outputText value="#{waveFileController.getWaveEquipmentType(we)}" />
							</p:column>
							<p:column headerText="录波器">
								<h:outputText value="#{we.name}" />
							</p:column>
						</p:dataTable>
						<p:separator />
						<p:fileUpload multiple="true" id="uploadCom"
									  disabled="#{waveFileController.selectedWaveEquipment==null}"
									  invalidFileMessage="文件扩展名必须是dat或者cfg"
									  allowTypes="/(\.|\/)(((c|C)(f|F)(g|G))|((d|D)(a|A)(t|T)))$/" label="选择" uploadLabel="上传"
									  cancelLabel="取消" fileUploadListener="#{waveFileController.handleWaveFileUpload}"
									  fileLimit="2" sequential="true" fileLimitMessage="文件个数必须是2个" mode="advanced"
									  update="form:msgs  uploadMsg waveFilePanel" />
						<p:outputLabel id="uploadMsg" style="color:red;font-size:16px;" escape="false"
									   value="#{waveFileController.uploadMsg}" />
						<br />
						<p:commandLink id="reBtn" value="继续上传" style="font-size:16px;color:#0080FF;margin-left:5px;"
									   rendered="#{waveFileController.btnAvailable()}"
									   actionListener="#{waveFileController.reUploadFile}"
									   update="form:msgs    uploadMsg waveFilePanel" />
						<p:commandLink id="cancleBtn" value="取消上传"
									   style="font-size:16px;color:#0080FF;margin-left:30px;"
									   rendered="#{waveFileController.btnAvailable()}"
									   actionListener="#{waveFileController.cancleUpload}"
									   update="form:msgs uploadMsg waveFilePanel" />
						<br />
					</p:outputPanel>
				</p:dialog>
			</h:form>
			<h:inputHidden value="#{faultReportController.selectEdit}" />
		</div>
		<h:form id="faultProcessDialogForm">
			<p:dialog id="faultProcessDialog" widgetVar="faultProcessDialog"
					  modal="true" header="故障分析" width="1400" height="600"
					  closable="true">
				<p:outputPanel id="faultProcessPanel">
					<p:dataTable id="faultProcessTable"
								 value="#{faultReportController.processNodes}" var="node"
								 emptyMessage="无记录">
						<p:column headerText="名称">
							<h:outputText value="#{node.processNode.name}" />
						</p:column>
						<p:column headerText="详情">
							<h:outputText value="#{node.handlerLog.log}" />
						</p:column>
						<p:column headerText="序号">
							<h:outputText value="#{node.processNode.orderNo}" />
						</p:column>
					</p:dataTable>
					<p:dataTable id="faultSources" var="info"
								 value="#{faultReportController.sourceInfos}" emptyMessage="无记录"
								 style="text-align:center;margin-top:30px;">
						<p:columnGroup type="header">
							<p:row>
								<p:column width="100" rowspan="2" headerText="厂站" />
								<p:column rowspan="2" headerText="集中录波" />
								<p:column colspan="2" headerText="主一保护" />
								<p:column colspan="2" headerText="主二保护" />
								<p:column colspan="2" headerText="主三保护" />
								<p:column colspan="3" headerText="断路器保护一" />
								<p:column colspan="3" headerText="断路器保护二" />
							</p:row>
							<p:row>
								<p:column headerText="报文" />
								<p:column headerText="录波" />
								<p:column headerText="报文" />
								<p:column headerText="录波" />
								<p:column headerText="报文" />
								<p:column headerText="录波" />
								<p:column width="100" headerText="名称" />
								<p:column headerText="报文" />
								<p:column headerText="录波" />
								<p:column width="100" headerText="名称" />
								<p:column headerText="报文" />
								<p:column headerText="录波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   value="#{s.stationName}"></p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.waveInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getCentralizedStr(s.waveInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main1DatagramInfo ==1? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.main1DatagramInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main1WaveInfo ==1 ? 'greenColor':'redColor'}"
											   value="#{faultReportController.getStateStr(s.main1WaveInfo)}" />
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main2DatagramInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.main2DatagramInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main2WaveInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.main2WaveInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main3DatagramInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.main3DatagramInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.main3WaveInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.main3WaveInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel title="#{s.breakerProtect1Name}"
											   style="white-space:pre;overflow:hidden;text-overflow:ellipsis">#{s.breakerProtect1Name}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.breakerProtect1DatagramInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.breakerProtect1DatagramInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.breakerProtect1WaveInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.breakerProtect1WaveInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel title="#{s.breakerProtect2Name}"
											   style="white-space:pre;overflow:hidden;text-overflow:ellipsis">#{s.breakerProtect2Name}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.breakerProtect2DatagramInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.breakerProtect2DatagramInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
						<p:column>
							<ui:repeat var="s" value="#{info.stationInfo}">
								<p:outputLabel style="width:100%;height:50%;"
											   styleClass="#{s.breakerProtect2WaveInfo ==1 ? 'greenColor':'redColor'}">#{faultReportController.getStateStr(s.breakerProtect2WaveInfo)}</p:outputLabel>
							</ui:repeat>
						</p:column>
					</p:dataTable>
				</p:outputPanel>
			</p:dialog>
		</h:form>
		<h:form id="noteForm">
			<p:dialog header="提示" widgetVar="noticeDialog" modal="true" resizable="false" height="100"
					  width="350" closable="true">
				<p:outputLabel value="大数据系统未找到此设备，是否要继续保存此故障！" />
				<hr />
				<p:commandButton value="确定" oncomplete="getTableScrollHeight();"
								 actionListener="#{faultReportController.continueSaveFault}" icon="ui-icon-check"
								 update="form:dataTb form:msgs" />
				<p:commandButton value="取消" style="margin-left:5px"
								 onclick="PF('noticeDialog').hide();getTableScrollHeight();" icon="ui-icon-close" />
			</p:dialog>
		</h:form>
		<!-- 编辑故障弹窗 -->
		<h:form id="faultForm">
			<p:dialog widgetVar="calendarDialog" header="时间选择" modal="true" resizable="false"
					  id="calendarDialog" width="280" closable="false">
				<p:calendar id="c" mode="inline" value="#{faultReportController.faultDate}" pattern="yyyy-MM-dd"
							navigator="true">
					<p:ajax event="dateSelect" listener="#{faultReportController.onDateSelect}" update="faultTime" />
				</p:calendar>
				<div style="padding-top: 5px">
					<div style="float: left">
						<p:selectOneMenu id="h" style="width:74px;text-align:center"
										 value="#{faultReportController.hour}">
							<p:ajax event="change" listener="#{faultReportController.onTimeChange}" update="faultTime" />
							<f:selectItem itemLabel="00" itemValue="00" />
							<f:selectItems value="#{faultReportController.getHours()}" />
						</p:selectOneMenu>
					</div>
					<span style="float: left; margin: 3px; font-weight: bold">:</span>
					<div style="float: left">
						<p:selectOneMenu id="m" style="width:74px" value="#{faultReportController.minute}">
							<p:ajax event="change" listener="#{faultReportController.onTimeChange}" update="faultTime" />
							<f:selectItem itemLabel="00" itemValue="00" />
							<f:selectItems value="#{faultReportController.getMinutesOrSeconds()}" />
						</p:selectOneMenu>
					</div>
					<span style="float: left; margin: 3px; font-weight: bold">:</span>
					<div style="float: left">
						<p:selectOneMenu id="s" style="width:74px" value="#{faultReportController.second}">
							<p:ajax event="change" listener="#{faultReportController.onTimeChange}" update="faultTime" />
							<f:selectItem itemLabel="00" itemValue="00" />
							<f:selectItems value="#{faultReportController.getMinutesOrSeconds()}" />
						</p:selectOneMenu>
					</div>
				</div>
				<p:commandButton value="确定" oncomplete="PF('calendarDialog').hide()"
								 actionListener="#{faultReportController.sameFaultTip}" update="faultForm:sameFauleDialog" />
			</p:dialog>
			<p:dialog id="sameFauleDialog" widgetVar="sameFauleDialog" header="相似故障提示" modal="true"
					  width="900">
				<p:outputLabel style="color:red;">以下为相似故障，请确认无误后填写。</p:outputLabel>
				<p:dataTable id="sameFaultTable" value="#{faultReportController.samefaults}" var="item">
					<p:column selectRow="false" width="45" headerText="故障时间 " style="text-align:center;">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="35" headerText="故障设备" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.equipment}" />
					</p:column>
					<p:column width="25" headerText="故障类型" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultType}" />
					</p:column>
					<p:column width="30" headerText="故障原因分类">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultReson}" />
					</p:column>
					<p:column width="15" headerText="相别" style="text-align:center">
						<h:outputText value="#{item.faultPhase}" />
					</p:column>
					<p:column width="60" headerText="行波测距">
						<h:outputText style="white-space:pre-wrap;" value="#{item.ranging}" escape="false" />
					</p:column>
					<p:column width="80" headerText="故障原因">
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.thunderInfo}"
									  escape="false" />
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.iceInfo}"
									  escape="false" />
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.remark}"
									  escape="false" />
					</p:column>
					<p:column width="80" headerText="故障过程">
						<h:outputText style="white-space:pre-wrap;" value="#{item.description}" escape="false" />
					</p:column>
					<p:column width="35" headerText="故障来源" style="text-align:center">
						<h:outputText rendered="#{null==item.source}" value="" />
						<h:outputText rendered="#{0==item.source}" value="人工创建" />
						<h:outputText rendered="#{1==item.source}" value="集中录波" />
						<h:outputText rendered="#{2==item.source}" value="保护录波" />
						<h:outputText rendered="#{3==item.source}" value="跳闸记录" />
						<h:outputText rendered="#{4==item.source}" value="调度日志" />
					</p:column>
				</p:dataTable>
				<br />
				<br />
				<p:commandButton value="确定" oncomplete="PF('sameFauleDialog').hide()" />
			</p:dialog>
			<p:dialog widgetVar="createFaultDialog" header="故障管理" modal="true" id="createFaultDialog"
					  width="1000">
				<p:messages id="noteMessage" showDetail="true" closable="true" />
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" oncomplete="getTableScrollHeight()"
										 actionListener="#{faultReportController.saveFault}"
										 update="form:dataTb form:msgs noteMessage  headForm:toolbar" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid id="panel" style="width:100%">
					<p:row>
						<p:column>
							<h:outputText value="*故障设备:" />
						</p:column>
						<p:column>
							<p:inputText id="equipment_text" disabled="#{!faultReportController.create}"
										 value="#{faultReportController.selected.equipment}">
								<p:ajax event="change" listener="#{faultReportController.sameFaultTip}"
										update="faultForm:sameFauleDialog" />
							</p:inputText>
							<p:commandButton value="选择设备" rendered="#{faultReportController.create}" process="@this"
											 style="margin-left:5px;" actionListener="#{faultReportController.getEquipmentByStation()}">
								<p:ajax event="dialogReturn" listener="#{faultReportController.onAnologSelectorChosen}"
										update="panel omsRow form:msgs faultForm:sameFauleDialog editBtn" />
							</p:commandButton>
						</p:column>
						<p:column>
							<h:outputText value="*设备类型 :" />
						</p:column>
						<p:column>
							<p:autoComplete id="equipment_type" disabled="#{!faultReportController.create}"
											value="#{faultReportController.selected.etype}" onkeyup="updateStation();"
											completeMethod="#{faultReportController.completeEtype}" scrollHeight="400" dropdown="true">
								<p:ajax event="itemSelect" listener="#{faultReportController.selecteTypeItem}"
										update="station2 station2Label :phaseForm:faultPhaseBox2" />
							</p:autoComplete>
						</p:column>
					</p:row>
					<p:row id="row2">
						<p:column>
							<h:outputText value="*变电站 ：" />
						</p:column>
						<p:column>
							<p:autoComplete id="station1" disabled="#{!faultReportController.create}"
											value="#{faultReportController.selected.stationName}"
											completeMethod="#{cimUtilController.completeCimStation500}" scrollHeight="400" dropdown="true">
								<p:ajax event="itemSelect" listener="#{faultReportController.onStartStationSelect}" />
							</p:autoComplete>
						</p:column>
						<p:column>
							<h:outputText id="station2Label" value="变电站2：" />
						</p:column>
						<p:column>
							<p:autoComplete id="station2"
											disabled="#{!faultReportController.create || !faultReportController.showStation2}"
											value="#{faultReportController.selected.stationName2}"
											completeMethod="#{cimUtilController.completeCimStation500}" scrollHeight="400" dropdown="true">
								<p:ajax event="itemSelect" listener="#{faultReportController.onEndStationSelect}" />
							</p:autoComplete>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="*设备电压（kV）:" />
						</p:column>
						<p:column>
							<p:autoComplete id="faultVoltages_text" value="#{faultReportController.selected.voltage}"
											completeMethod="#{faultReportController.completeVoltage}" scrollHeight="400" dropdown="true" />
						</p:column>
						<p:column>
							<h:outputText value="*故障时间 :" />
						</p:column>
						<p:column>
							<p:inputText id="faultTime" onclick="PF('calendarDialog').show()" autocomplete="off"
										 value="#{faultReportController.selected.faultTime}">
								<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
								<p:ajax event="click" update="c h m s"
										listener="#{faultReportController.preChangeFaultTime}" />
								<p:ajax event="change" listener="#{faultReportController.sameFaultTip}"
										update="faultForm:sameFauleDialog" />
							</p:inputText>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="*故障相别 :" />
						</p:column>
						<p:column>
							<p:inputText autocomplete="off" id="faultPhase_text"
										 value="#{faultReportController.selected.faultPhase}">
								<p:ajax event="focus" oncomplete="PF('chooseFaultPhase2').show()"
										update=":phaseForm:faultPhaseBox2" />
							</p:inputText>
						</p:column>
						<p:column>
							<h:outputText value="调度单位:" />
						</p:column>
						<p:column>
							<p:inputText id="dispatchUnitText" value="#{faultReportController.dispatchUnit}"
										 disabled="#{!faultReportController.create}" />
							<p:commandButton icon="ui-icon-pencil" style="margin-left:5px;width:28px" id="editBtn"
											 disabled="#{faultReportController.selected.equipment == null}"
											 actionListener="#{faultReportController.preEditLedger()}" oncomplete="PF('editDlg').show()"
											 update=":editForm:editDlg" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="故障类型:" />
						</p:column>
						<p:column>
							<p:autoComplete value="#{faultReportController.selected.faultType}"
											completeMethod="#{faultReportController.completeFaultTypeList}" scrollHeight="400"
											dropdown="true">
								<p:ajax event="itemSelect" listener="#{faultReportController.setFaultType}" />
							</p:autoComplete>
						</p:column>
						<p:column>
							<h:outputText value="故障原因分类:" />
						</p:column>
						<p:column>
							<p:autoComplete value="#{faultReportController.selected.faultReson}"
											completeMethod="#{faultReportController.complateFaultReason}" scrollHeight="400" dropdown="true" />
							<p:commandButton rendered="#{faultReportController.modelOperate}"   update="form:msgs"   id="incrementModel"  actionListener="#{faultReportController.incrementModel()}"
											 style="float:right;font-size:5px;margin:0px;padding:0px;" value="增量训练"  />
						</p:column>

					</p:row>
					<p:row id="omsRow"
					><!-- rendered="#{faultReportController.isAclineFault(faultReportController.selected)}" -->
						<p:column>
							<h:outputText value="是否推送到OMS服务" />
						</p:column>
						<p:column colspan="1">
							<p:selectBooleanCheckbox value="#{faultReportController.selected.sendToOms}" />
							<p:outputLabel style="color:red;margin-left:30px;"
										   rendered="#{faultReportController.OMSInfo != null}"
										   value="备注：#{faultReportController.OMSInfo}" />
						</p:column>

						<p:column  rendered="#{faultReportController.modelOperate}">
							<p:outputLabel value="故障原因分类(预测)：" />
						</p:column>
						<p:column rendered="#{faultReportController.modelOperate}">
							<p:inputText  id="faultForecastReson"  value="#{faultReportController.selected.faultForecastReson}" />
							<p:commandButton update="faultForecastReson  form:msgs preResult"  style="float:right;font-size:5px;margin:0px;padding:0px;"
											 value="重新预测" rendered="#{faultReportController.modelOperate}" oncomplete="showMessDialog()"   actionListener="#{faultReportController.rePredict()}"/>
						</p:column>

					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="故障过程:" />
						</p:column>
						<p:column colspan="3">
							<p:inputTextarea rows="7" value="#{faultReportController.selected.description}"
											 autoResize="false" style="width:100%" id="description">
								<p:ajax event="click" listener="#{faultReportController.genFaultDescription()}"
										disabled="#{faultReportController.ifClick}" update="description" />
							</p:inputTextarea>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="智能分析" />
						</p:column>
						<p:column colspan="3">
							<h:outputText rendered="#{faultReportController.selected.thunderInfo != null }"
										  rows="#{faultReportController.selected.iceInfo == null? 6:3}"
										  style="width:100%;display:block;" value="#{faultReportController.selected.thunderInfo}"
										  escape="false" />
							<h:outputText rendered="#{faultReportController.selected.iceInfo != null }"
										  rows="#{faultReportController.selected.thunderInfo == null? 6:3}"
										  style="width:100%;display:block" value="#{faultReportController.selected.iceInfo}"
										  escape="false" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<h:outputText value="故障原因（人工巡线结果）:" />
						</p:column>
						<p:column colspan="3">
							<p:inputTextarea rows="6" value="#{faultReportController.selected.remark}" style="width:100%"
											 autoResize="false" />
						</p:column>
					</p:row>
				</p:panelGrid>
			</p:dialog>
			<p:dialog widgetVar="receiveMessDialog" modal="true"
					  closable="true" draggable="true" width="200" height="60">
				<p:outputLabel  id="preResult" value="#{faultReportController.predictResult}"/>
			</p:dialog>
		</h:form>
		<h:form id="phaseForm">
			<!-- 选择故障相别 -->
			<p:dialog widgetVar="chooseFaultPhase2" header="选择故障相别" modal="true" id="chooseFaultPhase2"
					  width="360" height="150" style="align:center" resizable="false">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk"
										 actionListener="#{faultReportController.setupFaultPhase}"
										 update=":faultForm:faultPhase_text " oncomplete="PF('chooseFaultPhase2').hide()" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid columns="2" style="width:100%">
					<h:outputText value="相别:" />
					<p:selectManyCheckbox id="faultPhaseBox2" layout="grid" columns="3"
										  value="#{faultReportController.selectedPhase}">
						<f:selectItems value="#{faultReportController.phases}" />
					</p:selectManyCheckbox>
				</p:panelGrid>
			</p:dialog>
		</h:form>
		<h:form id="editForm">
			<p:dialog widgetVar="editDlg" id="editDlg" width="500px" height="400px" header="设备管理单位维护">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="确定" update=":faultForm:dispatchUnitText :form:msgs "
										 icon="ui-icon-disk" oncomplete="PF('editDlg').hide()"
										 actionListener="#{faultReportController.initDispatchUnit()}" />
						<p:commandButton value="取消" icon="ui-icon-disk" oncomplete="PF('editDlg').hide()" />
					</f:facet>
				</p:toolbar>
				<p:outputPanel style="width:100%;">
					<p:panelGrid style="width:100%;">
						<p:row>
							<p:column>
								<h:outputText value="设备名称" />
							</p:column>
							<p:column>
								<p:inputText value="#{faultReportController.ledger.name}" readonly="true" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="调度单位" />
							</p:column>
							<p:column>
								<p:inputText id="orgDept" value="#{faultReportController.ledger.dispatchUnit}"
											 readonly="true" />
								<p:commandButton value="选择" style="margin-left:5px"
												 actionListener="#{ledgerQueryDataController.getDesorgDepartDialog()}">
									<p:ajax event="dialogReturn" listener="#{faultReportController.onDesorgDepartChosen}"
											update="orgDept" />
								</p:commandButton>
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="资产归属" />
							</p:column>
							<p:column>
								<p:autoComplete scrollHeight="300" dropdown="true"
												value="#{faultReportController.ledger.assetOwner}"
												completeMethod="#{ledgerQueryDataController.completeAssetOwnerWhenEdit}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="运维单位" />
							</p:column>
							<p:column>
								<p:inputText id="opCompanyDept" value="#{faultReportController.ledger.maintenanceUnit}"
											 readonly="true" />
								<p:commandButton value="选择" style="margin-left:5px"
												 actionListener="#{ledgerQueryDataController.getOpDepartDialog()}">
									<p:ajax event="dialogReturn" listener="#{faultReportController.onOpDepartChosen}"
											update="opCompanyDept unitType" />
								</p:commandButton>
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="单位类型" />
							</p:column>
							<p:column>
								<p:autoComplete scrollHeight="300" dropdown="true" style="width:75%"
												value="#{faultReportController.ledger.unitType}" id="unitType"
												completeMethod="#{ledgerQueryDataController.completeUnitType}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="一次设备检修范围" />
							</p:column>
							<p:column>
								<p:inputText id="primary" value="#{faultReportController.ledger.primaryEquipmentScope}"
											 readonly="true" />
								<p:commandButton value="选择" style="margin-left:5px"
												 actionListener="#{ledgerQueryDataController.getPrimaryAndSecondaryScopeSelectDialog()}">
									<p:ajax event="dialogReturn" listener="#{faultReportController.onPrimaryScopeChosen}"
											update="primary" />
								</p:commandButton>
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="一次设备检修范围备注" />
							</p:column>
							<p:column>
								<p:inputText value="#{faultReportController.ledger.primaryEquipmentScopeRemark}" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="二次设备检修范围" />
							</p:column>
							<p:column>
								<p:inputText id="secondary" value="#{faultReportController.ledger.secondaryEquipmentScope}"
											 readonly="true" />
								<p:commandButton value="选择" style="margin-left:5px"
												 actionListener="#{ledgerQueryDataController.getPrimaryAndSecondaryScopeSelectDialog()}">
									<p:ajax event="dialogReturn" listener="#{faultReportController.onSecondryScopeChosen}"
											update="secondary" />
								</p:commandButton>
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="二次设备检修范围备注" />
							</p:column>
							<p:column>
								<p:inputText value="#{faultReportController.ledger.secondaryEquipmentScopeRemark}" />
							</p:column>
						</p:row>
					</p:panelGrid>
				</p:outputPanel>
			</p:dialog>
		</h:form>
		<h:form id="lockedForm">
			<p:dialog widgetVar="faultEditLockedInfo" id="faultEditLockedInfo" header="故障锁定情况" modal="true"
					  width="800" height="600">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="刷新" icon="ui-icon-refresh"
										 actionListener="#{faultEditLockedInfoController.init()}" update="lockedForm:lockedTable" />
					</f:facet>
				</p:toolbar>
				<p:dataTable id="lockedTable" paginator="true" rows="10"
							 value="#{faultEditLockedInfoController.lockedFaults}" var="item" rowKey="#{item.fault.id}"
							 paginatorPosition="bottom" emptyMessage="没有故障被锁定" rowIndexVar="ite">
					<p:column width="60" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="故障时间">
						<h:outputText value="#{item.fault.faultTime}">
							<f:convertDateTime pattern="yyyy-MM-dd hh:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column headerText="故障设备">
						<h:outputText value="#{item.fault.equipment}" />
					</p:column>
					<p:column headerText="占有人">
						<h:outputText value="#{item.lockData.owner}" />
					</p:column>
					<p:column>
						<p:commandButton value="解除锁定" update="lockedTable" icon="ui-icon-close"
										 actionListener="#{faultEditLockedInfoController.delocking(item.fault)}">
							<p:confirm header="提示" message="确定解锁该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
					</p:column>
				</p:dataTable>
			</p:dialog>
		</h:form>
		<!-- 录波文件下载 -->
		<h:form id="downloadForm">
			<p:dialog widgetVar="downloadWaveFileDialog" position="top" id="downloadWaveFileDialog"
					  header="录波文件下载" style="margin-top:50px;" modal="true" width="900" height="620">
				<p:outputPanel id="waveFilePanel">
					<table style="width: 100%">
						<tr>
							<td style="font-size: 16px; margin-left: 5px;">以下是本次故障所关联的故障录波文件, <p:commandLink
									style="font-size:16px;color:#0080FF;margin-left:5px;" value="点击下载" ajax="false"
									disabled="#{waveFileController.getWaveFileByStationId('').size()==0}"
									actionListener="#{waveFileController.prepareDownloadFile('')}">
								<p:fileDownload value="#{waveFileController.downloadFile}" />
							</p:commandLink>
							</td>
						</tr>
					</table>
					<p:dataTable id="sWaveFileTable" var="item"
								 value="#{waveFileController.getWaveFileByStationId('')}" rowKey="#{item.id}"
								 emptyMessage="无记录" rowIndexVar="ite">
						<f:facet name="header">
							录波文件
						</f:facet>
						<p:column width="2" headerText="序号 " style="text-align:center">
							<h:outputText value="#{ite+1}" />
						</p:column>
						<p:column width="10" headerText="时间">
							<h:outputText value="#{item.triggerSecond.substring(0,19)}">
							</h:outputText>
						</p:column>
						<p:column width="10" headerText="变电站名称">
							<h:outputText value="#{item.stationName}" />
						</p:column>
						<p:column width="10" headerText="装置">
							<h:outputText value="#{item.equipment}" />
						</p:column>
						<p:column width="50" headerText="录波文件">
							<h:outputText value="#{item.path}" />
						</p:column>
						<p:column width="10" headerText="文件来源">
							<h:outputText rendered="#{item.dataSource == 0}" value="系统获取" />
							<h:outputText rendered="#{item.dataSource == 1}" value="人工上传" />
						</p:column>
					</p:dataTable>
				</p:outputPanel>
			</p:dialog>
		</h:form>
		<h:form id="frequentFaultForm">
			<p:growl id="msgs" showDetail="true" />
			<p:dialog id="frequentFaultDialog" widgetVar="frequentFaultDialog" modal="true" width="1300"
					  height="600" header="故障确认">
				<p:outputPanel id="frequentFaultPanel">
					<span style="color: red; font-size: 20px;">系统检测到24小时内以下设备发生多次跳闸，疑似检修引起，请确认是否为故障：</span>
					<p:toolbar style="margin-top:10px;">
						<f:facet name="left">
							<p:commandButton value="置为非故障" icon="ui-icon-alert" oncomplete="PF('confirmDialog3').show()">
							</p:commandButton>
							<p:commandButton value="确认为故障" icon="ui-icon-alert" oncomplete="PF('confirmDialog4').show()">
							</p:commandButton>
						</f:facet>
					</p:toolbar>
					<p:dataTable id="frequentFaultTable" value="#{faultReportController.frequentFaults}" var="item"
								 rowKey="#{item.id}" emptyMessage="无记录"
								 selection="#{faultReportController.selectFrequentFaults}">
						<p:ajax event="rowSelectCheckbox" />
						<p:ajax event="rowUnselectCheckbox" />
						<p:ajax event="rowSelect" />
						<p:ajax event="rowUnselect" />
						<p:column selectionMode="multiple" style="width:8px;text-align:center" />
						<p:column headerText="故障设备" groupRow="true" width="10%">
							<h:outputText value="#{item.equipment}" />
						</p:column>
						<p:column headerText="故障时间" width="10%">
							<h:outputText value="#{item.faultTime}" />
						</p:column>
						<p:column headerText="故障类型" width="10%">
							<h:outputText value="#{item.faultType}" />
						</p:column>
						<p:column headerText="相别" width="5%">
							<h:outputText value="#{item.faultPhase}" />
						</p:column>
						<p:column headerText="故障来源" style="text-align:center" width="5%">
							<h:outputText rendered="#{null==item.source}" value="" />
							<h:outputText rendered="#{0==item.source}" value="人工创建" />
							<h:outputText rendered="#{1==item.source}" value="集中录波" />
							<h:outputText rendered="#{2==item.source}" value="保护录波" />
							<h:outputText rendered="#{3==item.source}" value="跳闸记录" />
							<h:outputText rendered="#{4==item.source}" value="调度日志" />
						</p:column>
						<p:column headerText="是否故障" width="5%">
							<h:outputText value="#{faultReportController.getStatusText(item.status)}" />
						</p:column>
					</p:dataTable>
				</p:outputPanel>
			</p:dialog>
		</h:form>
		<h:form id="confirmForm">
			<!-- 置为非故障确认 -->
			<p:dialog id="confirmDialog1" widgetVar="confirmDialog1" modal="true" header="提示" width="220"
					  height="120" closable="false">
				确定要修改故障状态吗？<br />
				<br />
				<br />
				<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
								 icon="ui-icon-check" oncomplete="PF('confirmDialog1').hide();getTableScrollHeight();"
								 actionListener="#{faultReportController.batchSetToNoFault}" update="form:dataTb form:msgs" />
				<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
								 oncomplete="PF('confirmDialog1').hide();getTableScrollHeight();" update="form:dataTb"
								 actionListener="#{faultReportController.queryByTime}" />
			</p:dialog>
			<!-- 置为故障确认 -->
			<p:dialog id="confirmDialog2" widgetVar="confirmDialog2" modal="true" header="提示" width="220"
					  height="120" closable="false">
				确定要修改故障状态吗？<br />
				<br />
				<br />
				<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
								 icon="ui-icon-check" oncomplete="PF('confirmDialog2').hide();getTableScrollHeight();"
								 actionListener="#{faultReportController.batchSetToFault}" update="form:dataTb form:msgs" />
				<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
								 oncomplete="PF('confirmDialog2').hide();getTableScrollHeight();" update="form:dataTb"
								 actionListener="#{faultReportController.queryByTime}" />
			</p:dialog>
			<!-- 疑似检修提示置为非故障确认 -->
			<p:dialog id="confirmDialog3" widgetVar="confirmDialog3" modal="true" header="提示" width="220"
					  height="120" closable="false">
				确定要修改故障状态吗？<br />
				<br />
				<br />
				<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
								 icon="ui-icon-check" oncomplete="PF('confirmDialog3').hide();getTableScrollHeight();"
								 actionListener="#{faultReportController.frequentFaultBatchSetToNoFault}"
								 update="form:dataTb frequentFaultForm:msgs frequentFaultForm:frequentFaultTable" />
				<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
								 oncomplete="PF('confirmDialog3').hide()" />
			</p:dialog>
			<!-- 疑似检修提示置为故障确认 -->
			<p:dialog id="confirmDialog4" widgetVar="confirmDialog4" modal="true" header="提示" width="220"
					  height="120" closable="false">
				确定要修改故障状态吗？<br />
				<br />
				<br />
				<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
								 icon="ui-icon-check" oncomplete="PF('confirmDialog4').hide();getTableScrollHeight();"
								 actionListener="#{faultReportController.frequentFaultBatchSetToFault}"
								 update="form:dataTb frequentFaultForm:msgs frequentFaultForm:frequentFaultTable" />
				<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
								 oncomplete="PF('confirmDialog4').hide()" />
			</p:dialog>
			<!-- 修改推送状态 -->
			<p:dialog id="confirmDialog5" widgetVar="confirmDialog5" modal="true" header="提示" width="220"
					  height="120" closable="false">
				确定要修改推送状态吗？<br />
				<br />
				<br />
				<p:commandButton value="是" process="@form" styleClass="ui-confirmdialog-yes"
								 icon="ui-icon-check" oncomplete="PF('confirmDialog5').hide();getTableScrollHeight();"
								 actionListener="#{faultReportController.batchSetToNoFault}" update="form:dataTb form:msgs" />
				<p:commandButton value="否" styleClass="ui-confirmdialog-no" icon="ui-icon-close"
								 oncomplete="PF('confirmDialog5').hide();getTableScrollHeight();" update="form:dataTb"
								 actionListener="#{faultReportController.queryByTime}" />
			</p:dialog>
		</h:form>
		<h:form id="mergePickForm">
			<p:dialog id="mergeFaultDialog" widgetVar="mergeFaultDialog" modal="true" header="合并故障"
					  width="1400" height="600" closable="true">
				<p:toolbar style="width:100%;margin-bottom:4px;">
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk" actionListener="#{faultReportController.saveMergeFault}" id="saveB"
										 update="form:dataTb   headForm:mergeFaultButton"  disabled="#{faultReportController.selected==null}"	oncomplete="PF('mergeFaultDialog').hide();getTableScrollHeight();" />
						<p:selectBooleanCheckbox style="color:red;margin-left:3px;"  itemLabel="将未选择故障记录置为非故障"
												 value="#{faultReportController.faultStatus}" />
					</f:facet>
				</p:toolbar>
				<h4 align="left">基准故障选择  </h4>
				<p:dataTable id="selectedFaults"   value="#{faultReportController.selectFaults}" var="item"
							 selection="#{faultReportController.selected}" rowKey="#{item.id}" emptyMessage="无记录" >
					<p:ajax event="rowSelectRadio"
							update="mergePickForm:saveB mergePickForm:attachment1  mergePickForm:wavefile1 mergePickForm:wavefile2  mergePickForm:attachment2"
							listener="#{faultReportController.onRowSelect}" />
					<p:column selectionMode="single" style="width:8px;text-align:center" />
					<p:column selectRow="false" width="60" headerText="故障时间 " style="text-align:center;">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="30" headerText="故障设备" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.equipment}" />
					</p:column>
					<p:column width="15" headerText="相别" style="text-align:center">
						<h:outputText value="#{item.faultPhase}" />
					</p:column>
					<p:column width="25" headerText="故障类型" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultType}" />
					</p:column>
					<p:column width="30" headerText="故障原因分类">
						<h:outputText style="white-space:pre-wrap;" value="#{item.faultReson}" />
					</p:column>

					<p:column width="60" headerText="故障原因">
						<h:outputText style="white-space:pre-wrap;display:block;" value="#{item.remark}"
									  escape="false" />
					</p:column>
					<p:column width="35" headerText="故障来源" style="text-align:center">
						<h:outputText rendered="#{null==item.source}" value="" />
						<h:outputText rendered="#{0==item.source}" value="人工创建" />
						<h:outputText rendered="#{1==item.source}" value="集中录波" />
						<h:outputText rendered="#{2==item.source}" value="保护录波" />
						<h:outputText rendered="#{3==item.source}" value="跳闸记录" />
						<h:outputText rendered="#{4==item.source}" value="调度日志" />
					</p:column>
				</p:dataTable>

				<div class="row" style="width:102%;padding-top:15px;">
					<div class="col-xs-12">
						<h4 align="left">附件</h4>
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border"  align="left">
									<p:outputLabel     value="#{faultReportController.selectFaults.get(0).stationName}"/>
								</div>
								<div class="box-body" >
									<p:pickList id="attachment1"  value="#{faultReportController.attachmentsPickList}" var="player"
												itemLabel="#{player.name}" itemValue="#{player.id}" style="margin-left:60px;">
										<f:facet name="sourceCaption">未存在</f:facet>
										<f:facet name="targetCaption">已存在</f:facet>
										<p:column style="width:75%;">#{player.name} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border" align="left">
									<p:outputLabel    value="#{faultReportController.selectFaults.get(0).stationName2}"/>
								</div>
								<div class="box-body">
									<p:pickList  id="attachment2" value="#{faultReportController.attachmentsPickList1}" var="item"
												 iconOnly="true" itemValue="#{item.id}"   itemLabel="#{item.name}"
												 style="margin-left:60px;">
										<f:facet name="sourceCaption">未存在</f:facet>
										<f:facet name="targetCaption">已存在</f:facet>
										<p:column style="width:75%;"> #{item.name} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row" style="width:102%;">
					<div class="col-xs-12">
						<h4 align="left">录波文件</h4>
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border" align="left">
									<p:outputLabel   value="#{faultReportController.selectFaults.get(0).stationName}"/>
								</div>
								<div class="box-body">
									<p:pickList  id="wavefile1"  value="#{faultReportController.waveFilePickList}" var="item" iconOnly="true"
												 itemValue="#{item}"   itemLabel="#{item}"
												 style="margin-top:20px;margin-left:60px;">
										<f:facet name="sourceCaption">未存在</f:facet>
										<f:facet name="targetCaption">已存在</f:facet>
										<p:column style="width:75%;">#{item} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border" align="left">
									<p:outputLabel    value="#{faultReportController.selectFaults.get(0).stationName2}"/>
								</div>
								<div class="box-body">
									<p:pickList id="wavefile2" value="#{faultReportController.waveFilePickList1}" var="item"
												iconOnly="true" itemValue="#{item}"  itemLabel="#{item}"
												style="margin-top:20px;margin-left:60px;">
										<f:facet name="sourceCaption">未存在</f:facet>
										<f:facet name="targetCaption">已存在</f:facet>
										<p:column style="width:75%;"> #{item} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
					</div>
				</div>
			</p:dialog>
			<p:dialog id="mergeFaultDialog1" widgetVar="mergeFaultDialog1" modal="true" header="选择录波文件"
					  width="1400" height="600" closable="true">
				<p:toolbar style="width:98%;">
					<f:facet name="left">
						<p:commandButton value="上一步"  oncomplete="PF('mergeFaultDialog1').hide();PF('mergeFaultDialog').show();" icon="ui-icon-right"/>
						<p:commandButton value="保存" icon="ui-icon-disk" actionListener="#{faultReportController.saveMergeFault}"
										 update="form:dataTb"	oncomplete="PF('mergeFaultDialog1').hide();getTableScrollHeight()" />
					</f:facet>
				</p:toolbar>
				<!-- <div class="row" style="width:98%;">
					<div class="col-xs-12">
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h4 class='box-title'>#{faultReportController.selectFaults.get(0).stationName}</h4>
									<p:outputLabel style="color:red;padding-left:5px;" value="(左侧选择框为该站包含的所有录波文件)"></p:outputLabel>
								</div>
								<div class="box-body">
									<p:pickList value="#{faultReportController.waveFilePickList}" var="item" iconOnly="true"
										itemValue="#{item}"   itemLabel="#{item}"
										style="margin-top:20px;margin-left:60px;">
										<p:column style="width:75%;">#{item} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
						<div class="col-lg-6 col-xs-6 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h4 class='box-title'>#{faultReportController.selectFaults.get(0).stationName2}</h4>
									<p:outputLabel style="color:red;padding-left:5px;" value="(左侧选择框为该站包含的所有录波文件)"></p:outputLabel>
								</div>
								<div class="box-body">
									<p:pickList value="#{faultReportController.waveFilePickList1}" var="item"
										iconOnly="true" itemValue="#{item}"  itemLabel="#{item}"
										style="margin-top:20px;margin-left:60px;">
										<p:column style="width:75%;"> #{item} </p:column>
									</p:pickList>
								</div>
							</div>
						</div>
					</div>
				</div> -->
				<!--  <p:selectBooleanCheckbox style="color:red;margin-left:3px;"  itemLabel="将未选择故障记录置为非故障"
                  value="#{faultReportController.faultStatus}" />
               <p:dataTable value="#{faultReportController.selectFaults}" var="item"
                   selection="#{faultReportController.selected}" rowKey="#{item.id}" emptyMessage="无记录">
                   <p:column selectionMode="single" style="width:8px;text-align:center" />
                   <p:column selectRow="false" width="40" headerText="故障时间 " style="text-align:center;">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.faultTime}">
                           <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
                       </h:outputText>
                   </p:column>
                   <p:column width="30" headerText="故障设备" style="text-align:center">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.equipment}" />
                   </p:column>
                   <p:column width="25" headerText="故障类型" style="text-align:center">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.faultType}" />
                   </p:column>
                   <p:column width="30" headerText="故障原因分类">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.faultReson}" />
                   </p:column>
                   <p:column width="15" headerText="相别" style="text-align:center">
                       <h:outputText value="#{item.faultPhase}" />
                   </p:column>
                   <p:column width="60" headerText="行波测距">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.ranging}" escape="false" />
                   </p:column>
                   <p:column width="60" headerText="故障原因">
                       <h:outputText style="white-space:pre-wrap;display:block;" value="#{item.remark}"
                           escape="false" />
                   </p:column>
                   <p:column width="60" headerText="智能分析">
                       <h:outputText style="white-space:pre-wrap;display:block;" value="#{item.thunderInfo}"
                           escape="false" />
                       <h:outputText style="white-space:pre-wrap;display:block;" value="#{item.iceInfo}"
                           escape="false" />
                   </p:column>
                   <p:column width="105" headerText="故障过程">
                       <h:outputText style="white-space:pre-wrap;" value="#{item.description}" escape="false" />
                   </p:column>
               </p:dataTable> -->
			</p:dialog>
		</h:form>
		<h:form>
			<p:dialog header="上传文件" widgetVar="fileUploadDialog" modal="true" id="fileUploadDialog" width="640" height="200">
				<p:fileUpload style="margin-top:10px" allowTypes="/(\.|\/)(xlsx)$/"
							  fileUploadListener="#{faultReportController.handleFileUpload}" uploadLabel="上传" label="文件"
							  oncomplete="PF('fileUploadDialog').hide()"/>
			</p:dialog>
		</h:form>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/js/tables/singleScrollTable.js" />
		<script src="/ui/map/dialog/riskAlarmDialog/searchAlarmMsgDlg.js?version=1.0" />
		<script>
			function showMessDialog() {//原因预测时显示dialog
					PF('receiveMessDialog').show();
			}
		
		
			function openFaultReport(path) {
				if (path) {
					layer.open({
						type : 2,
						maxmin : false,
						area : [ '90%', '90%' ],
						fixed : false, //不固定
						title : '故障报告',
						maxmin : true,
						content : path,
					});
				}
			}



			function openFaultLogReport(path) {
				if (path) {
					layer.open({
						type : 2,
						maxmin : false,
						area : [ '80%', '80%' ],
						fixed : false, //不固定
						title : '故障分析日志',
						maxmin : true,
						content : path,
					});
				}
			}

			function afterCreate() {
				PF('editDlg').hide();
				getTableScrollHeight();
			}
		</script>
	</ui:define>
</ui:composition>